package com.iwat.spring.aop.controller;

import com.iwat.spring.aop.annotation.OperLog;
import com.iwat.spring.aop.constant.OperationType;
import com.iwat.spring.aop.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author wangweiqiang
 * @Classname TestController
 * @Date 2021/12/6 11:12
 * @Description
 */
@RestController
public class TestController {
    @Autowired
    private TestService testService;

    @OperLog(message = "myMessage",operation = OperationType.ADD)
    @GetMapping("/test")
    public Map<String,Object> test(){
        testService.test();
        return new HashMap<String,Object>(){{put("msg","测试日志切面！");}};
    }
}
